-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Theming improvements, other fixes #176
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Using the real height of each line causes alignment issues for multiline text. Just use a placeholder height for multiline based on `My` to have a tall letter and one going below baseline.
Based on given `seq[Value]` argument.
If compiled with `-d:WritePlotCsv` has the option to automatically write out CSV files for input DF for each plot that is created (if enabled via environment variable)
Before we used the entire scale of the viewport, which is wrong if multiple geoms are used, some of which go beyond the raster image!
This can happen if the y limit is changed by hand or the user uses a log10 plot with ~stat = "identity"~
Default was 0.3 cm. Now can be adjusted.
The idea is: If any of the axes is *continuous* then all others should be continuous too. This is important if adding a single geom that only has 1 element (and such is `colConstant` -> "discrete") to get the desired plot
Most processing is now done in `postprocess_scales` where it fits better. Makes the `scale_x/y_date` logic work in facet plots by using the relevant data and not the input `p.data` DF.
It does not yet support all types for the fields!
Vindaar
force-pushed
the
textAlignmentFixes
branch
from
January 31, 2024 12:15
0bb2983
to
af578d2
Compare
(Still to be merged!)
Can still be left enabled if `useWithoutTeX` is set to `true`. I found that by default it's not desirable.
Due to minor theme changes the numbers are adjusted again.
These have been made redundant. At some point in the future we may wish to enable such a thing again, but that requires a bit of thought where such an exception would then be thrown
(because we call ~ggcreate~ without calling save / handing a filename)
Recent version differences between my Void Cairo and standard ubuntu seem to move the text a minute amount more than in the past? Something is up, but debugging it is tricky. I verified the plots look fine by eye on Ubuntu and there is only a very small difference between expected and produced. These thresholds should be fine.
Vindaar
force-pushed
the
textAlignmentFixes
branch
from
February 11, 2024 12:58
9a03c68
to
b74a2e8
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This turned into a massive PR, as it grew during writing of my thesis where I didn't have the time and motivation to properly finish individual things as a PR.
The majority of improvements are related to theming a plot. Essentially every aspect of a plot is now adjustable via the
Theme
object. In addition the theme can now also be changed at runtime based on a TOML file that describes the theme.For example:
This as a TOML file needs to be handed to the
tomlTheme
proc. It will apply all the theme fields to the plots.Another very useful feature is
WritePlotCsv
. An optional compile time + runtime switch feature. If you ever wanted to easily share data for a plot, this is for you. By compiling with-d:WritePlotCsv
you compile in a runtime check for aWRITE_PLOT_CSV=true
environment variable value. If that value is set,ggplotnim
will write CSV files for every data frame given to aggplot
call. One CSV file for each data frame to a call (meaning eachgeom
with a custom DF as well) will be written with the same filename as the plot, but a.csv
suffix. For additional geoms an additional geom suffix is added. It makes sharing data together with plots much easier. In the future I'll likely add some options to adjust the paths for the generated files and possibly allow merging of data files into binary (https://github.com/c-blake/nio) or HDF5 formats for cases of plots with massive input DFs.Full changelog: